import {
    forIn
} from 'lodash-es';
import {
    Request
} from './http'

//左模块  上标图
export async function GETDATA(url, data, params) {
    let config = {
        url: window.PATH + url,
        data,
        params
    }
    return Request(config).then(response => response.data).catch(error => error);
}

//获取班级下拉列表
export async function GetLists() {
    return Request({
        url: window.PATH + NJLIST,
        data: {
            "code": "04"
        }
    }).then(res => res.data).catch(err => err)
}

// 近五年在校人数
export const A = 'bigdata/queryTermStudentList'
// 在校生年龄分布
export const B = 'bigdata/queryStudentsAgeList'
// 学习专业TOP榜
export const C = 'bigdata/professionList'
// 在校生性别比例
export const D = 'bigdata/sexRatio'
// 查询在校生人数
export const E = 'bigdata/countStudents'
//查询测试资源总数
export const F = 'bigdata/countCeShiTiMu'
//查询视频课件总数
export const G = 'bigdata/countKeChengNeiRong'
//查询专业变化趋势
export const H = 'bigdata/zhuanyeChangeTrendList'
//查询专业列表
export const I = 'bigdata/zhuanyeList'
//查询考试分布
export const J = 'bigdata/chengJiChangeTrendList'
//查询课程通过率
export const K = 'bigdata/coursePassRateList'
//查询观看渠道
export const L = 'bigdata/viewList'
//班级列表
export const NJLIST = 'zdepartments/getList'
//课程列表
export const KCLIST = 'course/getCourseByPage'
//   {"code":"04"}
export function getField(arr, key) { //arr对象数组,要取出的key
    let A = []
    forIn(arr, (v, i) => {
        A[i] = v[key]
    })
    return A
}